package com.yasaka.stock.web;

import com.yasaka.stock.auth.AuthTokenManager;
import com.yasaka.stock.service.EclAuthService;
import com.yasaka.stock.vo.TokenVo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class AuthController {

    @Resource
    EclAuthService eclAuthService;

    @RequestMapping(value = "/token", method = RequestMethod.GET)
    public TokenVo token(@RequestParam String appId, @RequestParam String appSecret) {
       return AuthTokenManager.generateToken(appId,appSecret);
    }
}
